<?php
/**
 *
 * @param Submission_Model $submission
 * @param object $post
 * @return success
 */
function submit($submission)
{
    if ($_FILES['submissionfile']['error'] != UPLOAD_ERR_OK) return false;
    $sourcefilename = $_FILES['submissionfile']['name'];
    $filetype = source::type($sourcefilename);
    if ($filetype == 'unknown') return false;
    $filecontent = file_get_contents($_FILES['submissionfile']['tmp_name']);
    $submission->set_submit_content('source_lang', $filetype);
    $submission->set_submit_content('original_name', $sourcefilename);
    $submission->set_submit_content('source_content', $filecontent);
    return true;
}